package com.woniu.market_stall_web.mapper;

import com.woniu.market_stall_web.entity.StallAuction;
import com.woniu.market_stall_web.vo.AuctionRoomVo;
import com.woniu.market_stall_web.vo.StallAuctionVo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Repository
public interface StallAuctionMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(StallAuction record);

    StallAuction selectByPrimaryKey(Integer id);

    List<StallAuction> selectAll();

    int updateByPrimaryKey(StallAuction record);

    List<AuctionRoomVo> selectRoomByStallId(@Param("stallId") int stallId, @Param("username") String username);

    void insertBidUser(@Param("stallId") int stallId, @Param("username") String username);

    void insertBidPrice(@Param("stallId")int stallId, @Param("username") String username, @Param("bidPrice") int bidPrice ,@Param("bidTime") Date bidTime);

    int selectMaxBidPrice(@Param("stallId") int stallId);

    AuctionRoomVo selectWinnerByBidPriceAndStallId( @Param("stallId")int stallId );


    //竞拍中
    List<StallAuctionVo>selectBidding(String username);

    //已中标
    List<StallAuctionVo>selectWin(String username);

    //查所有
    List<StallAuctionVo>select(String username);


}